/*!
 * \file apex_booster.cpp
 * \brief bootser implementation 
 * \author Tianqi Chen: tqchen@apex.sjtu.edu.cn
 */
// implementation of boosters go to here 
#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_DEPRECATE
#include <climits>
#include "apex_booster.h"
#include "../../apex-utils/apex_utils.h"
namespace apex_booster{
    const bool rt_debug = false;
    // whether to check bugs
    const bool check_bug = false;
    
    const float rt_eps = 1e-5f;
    const float rt_2eps = rt_eps * 2.0f;

    inline double sqr( double a ){
        return a * a;
    }    
    inline void assert_sorted( unsigned *idset, int len ){
        if( !rt_debug || !check_bug ) return;
        for( int i = 1; i < len; i ++ ){
            apex_utils::assert_true( idset[i-1] < idset[i], "idset not sorted" );
        }
    }
};

#include "apex_gbtree.h"
namespace apex_booster{
    IBooster *create_booster( int bst_type ){
        // for extension purpose
        return new GBTreeTrainer();
    }
};
